<?php
/**
 * Created by PhpStorm.
 * User: eric
 * Date: 2020/6/3
 * Time: 16:59
 */
namespace App\Admin\Extensions\Action;

use Encore\Admin\Actions\RowAction;

class PageJumpAction extends RowAction
{
    public $name = '跳转';
    public $url = '/admin';

    public function __construct($name = '跳转', $url ='/admin')
    {
        parent::__construct();
        $this->name = $name;
        $this->url = $url;
    }

    /**
     * 在href方法中可以用$this->getResource()，获取当前的资源根路径，可以用$this->getKey()获取当前行的主键值
     * @return string
     */
    public function href()
    {
        return $this->url;
    }
}